package com.galaxis.wms.query

import com.galaxis.wms.entity.BasRole
import com.querydsl.core.types.Path
import com.querydsl.core.types.PathMetadata
import com.querydsl.core.types.dsl.DateTimePath
import com.querydsl.core.types.dsl.NumberPath
import com.querydsl.core.types.dsl.StringPath
import com.querydsl.sql.ColumnMetadata
import com.querydsl.sql.RelationalPathBase

import java.sql.Timestamp
import java.sql.Types

import static com.querydsl.core.types.PathMetadataFactory.forVariable

/**
 * 角色(bas_role)
 */
@SuppressWarnings("ALL")
class QBasRole extends RelationalPathBase<BasRole> {
    /** bas_role表 */
    public static final QBasRole basRole = new QBasRole("bas_role")

    /** 角色ID */
    public final NumberPath<Long> roleId = createNumber("roleId", Long.class)
    /** 角色编码 */
    public final StringPath roleCode = createString("roleCode")
    /** 角色名称 */
    public final StringPath roleName = createString("roleName")
    /** 是否启用 */
    public final StringPath isEnable = createString("isEnable")
    /** 创建人 */
    public final StringPath createBy = createString("createBy")
    /** 创建时间 */
    public final DateTimePath<Timestamp> createAt = createDateTime("createAt", Timestamp.class)
    /** 更新人 */
    public final StringPath updateBy = createString("updateBy")
    /** 更新时间 */
    public final DateTimePath<Timestamp> updateAt = createDateTime("updateAt", Timestamp.class)

    QBasRole(String variable) {
        super(BasRole.class, forVariable(variable), "public", "bas_role")
        addMetadata()
    }

    QBasRole(String variable, String schema, String table) {
        super(BasRole.class, forVariable(variable), schema, table)
        addMetadata()
    }

    QBasRole(String variable, String schema) {
        super(BasRole.class, forVariable(variable), schema, "bas_role")
        addMetadata()
    }

    QBasRole(Path<? extends BasRole> path) {
        super(path.getType(), path.getMetadata(), "public", "bas_role")
        addMetadata()
    }

    QBasRole(PathMetadata metadata) {
        super(BasRole.class, metadata, "public", "bas_role")
        addMetadata()
    }

    void addMetadata() {
        addMetadata(roleId, ColumnMetadata.named("role_id").withIndex(1).ofType(Types.BIGINT).withSize(64))
        addMetadata(roleCode, ColumnMetadata.named("role_code").withIndex(2).ofType(Types.VARCHAR).withSize(255))
        addMetadata(roleName, ColumnMetadata.named("role_name").withIndex(3).ofType(Types.VARCHAR).withSize(255))
        addMetadata(isEnable, ColumnMetadata.named("is_enable").withIndex(4).ofType(Types.VARCHAR).withSize(50))
        addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(5).ofType(Types.VARCHAR).withSize(64))
        addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(6).ofType(Types.TIMESTAMP).withSize(100))
        addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(7).ofType(Types.VARCHAR).withSize(64))
        addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(8).ofType(Types.TIMESTAMP).withSize(100))
    }
}
